"use strict"

/**
 * 长沙市政府采购网爬虫
 *  
 */

var Base = require("./base");
var cs_spider = new Base();
cs_spider.name = "长沙市政府采购网";

cs_spider.getPageUrl = function (pg) {
    return "http://changs.ccgp-hunan.gov.cn:8717/noticeAction!showSub_gonggaolist.action?1=1&currentPage=" + pg + "&query.title=&query.cglb=&query.gglx=&query.cgfs=1&query.time_s=&query.time_e=&query.areacode=&query.endtime_s=&query.endtime_e=";
}

cs_spider.getItems = function ($) {
    var items = [];
    $(".sub_list_content ul li a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://changs.ccgp-hunan.gov.cn:8717/" + e.attr("href");
        item.source = cs_spider.name;
        items.push(item);
    });
    return items;
}

exports = module.exports = cs_spider;
